import request from '@/utils/request'
import type { Enterprise } from 'vue'
export function addEnterpriceCertifcation(data: unknown) {
  return request({
    url: '/manage/enterprise/addCertification',
    method: 'post',
    data: data,
  })
}
export function updateCertification(data: unknown) {
  return request({
    url: '/manage/enterprise/updateCertification',
    method: 'put',
    data: data,
  })
}
export function updateEnterpriceCertifcation(data: object) {
  return request({
    url: '/manage/enterprise',
    method: 'put',
    data: data,
  })
}

export function getLegalPerson(id: string) {
  return request({
    url: '/manage/legal/single/' + id,
    method: 'get',
  })
}
export function swithMainSign(params: object) {
  return request({
    url: '/manage/enterprise/swithMainSign',
    method: 'get',
    params,
  })
}

export function getEenterpriceList(params?: object) {
  return request({
    url: '/manage/enterprise/getEnterpriseByUser',
    method: 'get',
    params,
  })
}

export function getEnterpriseInfo(id: string) {
  return request({
    url: '/manage/enterprise/moreInfo/' + id,
    method: 'get',
  })
}

export function addFinancingInfo(data) {
  return request({
    url: '/manage/demand/addFinancingInfo',
    method: 'post',
    data: data,
  })
}
export function cancelFinance(id: number) {
  return request({
    url: '/manage/demand/cancelFinance/' + id,
    method: 'put',
  })
}
// 添加联系人
export function addContact(data) {
  return request({
    url: '/manage/contact',
    method: 'post',
    data: data,
  })
}
// 添加联系人
export function delContact(id: number) {
  return request({
    url: '/manage/contact/' + id,
    method: 'delete',
  })
}
// 获取联系人列表
export function getContactList(params?: object) {
  return request({
    url: '/manage/contact/list',
    method: 'get',
    params,
  })
}

export function checkEnterprise(data: object) {
  return request({
    url: '/manage/check/enterprise',
    method: 'get',
    params: data,
  })
}
